<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="applicable-device" content="mobile">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta content="telephone=no,email=no" name="format-detection"/>
    <meta name="description" content="西山居游戏">
    <meta name="keywords" content="西山居游戏">
    <title>移动版官方网站-西山居游戏</title>
    <link href="assets/css/style.css" rel="stylesheet" />
</head>

<body>
<button class="J_tongjiBtn">埋点按钮</button>
<div class="domreg9" style="width:300px;padding:0 20px;float:left;">
    <h2>登录-绑定按钮极验-没有输入框 支持wegame登录</h2>
    <div class="xsj_register_dom_nine">
    </div>
</div>


<script src="//zhcdn01.xoyo.com/xassets/lib/jquery/1.7.2/jquery.js"></script>
<script src="//zhcdn01.xoyo.com/xassets/com/pf/register/jsreg/v2/register.js"></script>
<script src="//zhcdn01.xoyo.com/xassets/com/pf/footer/v2/black/m/footernofont.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="//zhcdn01.xoyo.com/xassets/com/wx/useWxApi/v2/useWxApi.js"></script>
<script src="//zhcdn01.xoyo.com/xassets/lib/daily-app-auth/0.0.1/daily-app-auth.js"></script>
<script src="//zhcdn01.xoyo.com/xassets/lib/daily-app-auth/0.0.1/get-daily-account-info.js "></script>
<script class="trackerBefore">
    window.$$exports = window.exports;
    window.exports = {};
</script>
<script class="tracker" src="//zhcdn01.xoyo.com/xassets/lib/st-report-sdk/0.2.3/st-report-sdk.min.js"></script>
<script class="trackerAfter">
    window.StReportSdk023 = window.exports.StReportSdk;
    window.exports = window.$$exports;
</script>
<script>
    /**
     *
     * @param eventName  事件名称，对应统计文档ev_n
     * @param eventDescription 事件描述，对应统计文档ev_desc
     * @param ret_code 错误提示码,常用于后端接口返回的错误状态码，如 -20001
     * @param ret_msg 错误提示文案，常用于后端接口返回错误描述，如： XX失败
     */

    /**
     * 调用方法，比如： window.stReportGlobal('load_page','页面加载');
     */
    const StReportSdk023Report = StReportSdk023.getInstance('jx3_test_maidian'); //埋点的组名
    window.stReportGlobal023MultiProps = function ({eventName, eventDescription, status, ev_status_reason, title, passport}) {
        // * @param projectIdentifier [string] - 项目标识（[A-Za-z_]+{4, },内部约定），必选
        // * @param eventName [string] - 事件名称，（格式与时间分组一致），可选
        // * @param eventGroup [string] - 事件分组（[A-Za-z_\-]+{1,},内部约定），可选 ，对应统计文档： ev_g
        // * @param eventDescription [string]- 事件描述（字符串）
        // * @param eventDataValue [object] - 事件额外数据对象，kv对，可选, 如: evd[k1]=v1&evd[k2]
        // * @param eventTags [string[]] - 事件标签数组（格式与时间分组一致），可选 ，对应统计文档：ev_tag
        try {
            StReportSdk023Report.report({
                eventName: eventName,
                projectIdentifier: 'jx3',
                eventDescription: eventDescription,
                eventTags: ['pc', 'match'], //埋点标签
                eventGroup: 'jx3_test_maidian',  //埋点的组名
                eventDataValue: {
                    title: title ? title : undefined,
                    status: status ? status : undefined,
                    ev_status_reason: ev_status_reason ? ev_status_reason : undefined,
                    passport: passport ? passport : undefined,
                    td_pl: StReportSdk023.getDiffRouteTime(),
                }
            });
        } catch (e) {
            setTimeout(() => {
                throw e;
            });
        }
    }
    var dateNews2 = new Date().getTime();
    var timejian = dateNews2 - window.inPageDate;
    window.stReportGlobal023MultiProps({eventName: 'load_page_start', eventDescription: '页面加载'});
</script>

<script>
    var isMaster = true; //环境切换 正式是true, 测试环境是false
    var passportApi = isMaster ? '//pf-api.xoyo.com/' : '//my-api-dev.xoyo.com/';
    var isLogin = false; //默认没有登录
    $(function () {

        //埋点DEMO start
        $('.J_tongjiBtn').on('click', function () {
            alert('11')
            window.stReportGlobal023MultiProps({eventName: 'test', eventDescription: '测试'});
        });

        //埋点DEMO end

        //微信自定义分享 start
        var eventData = {
            title: '剑侠世界手游，关注赢取小米MIX',
            link: 'http://js.xoyo.com/zt/2016/10/operate/index.html',
            imgUrl: 'http://js.xoyo.com/zt/2016/10/operate/share.jpg',
            desc: '剑侠世界手游版 - 一生不可错过的浪漫武侠'
        }
        usewxapi.getSignature(eventData);
        //微信自定义分享 end

        //登录框 初始化 start
        $('.xsj_register_dom_nine').registerPublic({
            ajaxUrl: passportApi, //用于测试接口
            domName:'.xsj_register_dom_nine',
            regTag:9,
            isLogin: true,
            loginModel:true,
            client:'jx3',
            isWegameLogin: true, //wegame login
            jiyanBind:true,
            isLogOutCallback: true, //开启退出回调
            onStart: function(){
                $('.J_loginPubUser').attr('placeholder', '金山通行证（账号/手机/邮箱）');
                $('.J_loginPubpass').attr('placeholder', '输入密码');
            },
            cbLogOut:function () {
                alert('退出成功')
            },
            cbLoginSuccess:function($loginOkuser){ //一进入页面就判断用户是否登录 如果登录就执行此方法 并返回用户名
                alert($loginOkuser);
            },
            cbLoginModelSuccess: function($user){ //用户未登录时，显示登录框，点击登录按钮，例如成功后执行的回调
                //登录成功回调
                alert($user)
            }
        });
        //登录框 初始化 end

        //第三方登录 start
        if(window.THIRD_PARTY_AUTH.ua === 'daily' && window.THIRD_PARTY_AUTH.status === 'success'){
            isLogin = true; //表示已经在第三方（剑网3推栏）登录
        }
        //有两层登录，如果有第三方登录，就不用再判断xoyo登录了
        //第三方推栏登录成功返回
        //         {
        //             "ua": "daily",
        //             "status": "success",
        //             "data": {
        //                  "uid_encode": "c4e60ae03514c02ec5ebf4748eb5a2006fc092b0",
        //                 "account": "hdt***062",
        //                 "zone_name": "测试专区",
        //                 "server_name": "聊天测试",
        //                 "token": "0cd31785fd3a460d8c17af19de181b11",
        //                 "force": "蓬莱",
        //                 "bodily": "成男",
        //                 "person_name": "辣条",
        //                 "person_avatar": "https://qdla.pvp.xoyo.com/dev/avatar/tmp/f8c146ac3ec24bab9adf21f3881a288a/avatar.jpg/d0d100fff27645108cea5afc1e47b0d4.jpg",
        //                 "is_wegame": 0,
        //                 "session_id": "WpMtMML4mhYGgdsWkuXD4BKY620UB5t8Jvdvzqhp",
        //                 "request_id": "11878089719ae013f79321d21d9ba3f674ce19b8"
        //         }
        //第三方登录 end
    })
</script>
</body>

</html>